const fs = require("fs");
const path = require("path");
const contentPath = path.resolve(__dirname, "./data.txt");
const copyPath = path.resolve(__dirname, "./data-bak.txt");

// 同步复制
const rs = fs.createReadStream(contentPath);
const ws = fs.createWriteStream(copyPath);

rs.on("data", (chunk) => {
  ws.write(chunk);
});
